package cn.wolfcode.trip.base.domain;


import cn.wolfcode.trip.base.util.JSONUtil;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.HashMap;
import java.util.Map;

//大攻略
@Getter@Setter@ToString
public class Strategy extends  BaseDomain{
    public static final Integer STATE_COMMON=0;//普通
    public static final Integer STATE_HOT=1;//热门
    public static final Integer STATE_DISABLED=-1;//禁用

    private Region place;

    private String title;

    private String subTitle;

    private String coverUrl;

    private Integer state=STATE_COMMON;

    public String getStateName(){
        String stateName = "普通";
        if (STATE_HOT.equals(state)){
            stateName="热门";
        }else{
            stateName="禁用";
        }
        return stateName;
    }

    public Object getJson(){
        Map<String,Object> map = new HashMap<>();
        map.put("id",id);
        map.put("title",title);
        map.put("place",place);
        map.put("subTitle",subTitle);
        map.put("coverUrl",coverUrl);
        map.put("state",state);

        return JSONUtil.toJSONString(map);
    }

}